import { getFactoryEmpAccountList } from '@/api/merchant'
import { ref } from 'vue'

// 获取商家详情之账号管理加载
const loading = ref(false)

// 获取商家详情之账号管理列表
const list = ref([])

// 列表总条数
const total = ref(0)

const getList = async (id: string, data: { limit: number; name: string; page: number }) => {
  loading.value = true
  const res = await getFactoryEmpAccountList(id, data)
  total.value = Number(res.data.data.total)
  list.value = res.data.data.rows
  loading.value = false
}

export default {
  list,
  total,
  loading,
  getList,
}
